import {
    TEXT,
    PASSWORD,
    READIO,
    identOptions,
    validatePhone,
    validateEmail,
    validatorCheckpass
} from '@/config/form-type-config'

export default {
    columns: [
        [{ label: '账户名', key: 'username', colspan: 24, type: TEXT, value: '' }],
        [{ label: '邮箱', key: 'email', colspan: 24, type: TEXT, value: '' }],
        [{ label: '手机号码', key: 'phoneNumber', colspan: 24, type: TEXT, value: '' }],
        [{ label: '密码', key: 'password', colspan: 24, type: PASSWORD, value: '' }],
        [{ label: '确认密码', key: 'checkPass', colspan: 24, type: PASSWORD, value: '' }],
        [{ label: '所属', key: 'status', colspan: 24, type: READIO, value: '普通管理员', radios: identOptions }],
    ],
    rules: {
        name: [
            { required: true, message: '请输入活动名称', trigger: 'blur' },
            { min: 3, max: 8, message: '长度在 3 到 8 个字符', trigger: 'blur' }
        ],
        email: [{ required: true, validator: validateEmail, trigger: "blur" }],
        phoneNumber: [{ required: true, validator: validatePhone, trigger: "blur" }],
        password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
        checkPass: [
            { required: true, message: '请输入确认密码', trigger: 'blur' },
            { validator: validatorCheckpass, trigger: "blur" },
        ],
    }
}